import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 分页列表
export function list (query) {
    return request({
        url: '/school/class/devicePage',
        method: 'get',
        params: query
    })
}

// 详情
export function getById (query) {
    return request({
        url: '/school/class/getById/' + query.id,
        method: 'get',
        params: query
    })
}

// 新增
export function add (data) {
    return request({
        url: '/school/class/add',
        method: 'post',
        data: data
    })
}

// 修改
export function edit (data) {
    return request({
        url: '/school/class/edit',
        method: 'put',
        data: data
    })
}

// 删除
export function deleteById (data) {
    return request({
        url: '/school/class/deleteById/' + data.id,
        method: 'delete',
        data
    })
}

// 根据登录账号获取班级信息列表
export function getClassList (query) {
    return request({
        url: '/school/class/getClassList',
        method: 'get',
        params: query
    })
}

// 根据学校id班级信息
export function getClassListBySchoolId (query) {
    return request({
        url: '/school/class/getClassListBySchoolId',
        method: 'get',
        params: query
    })
}

// 根据班级名称获取班级信息列表
export function getListByClassName (query) {
    return request({
        url: '/school/class/getListByClassName',
        method: 'get',
        params: query
    })
}

// 冻结/解冻
export function setStatus (id) {
    return request({
        url: '/school/class/setStatus/' + id,
        method: 'put'
    })
}

